<layout name="layout" />
                <div class="page-header"><!-- Page header -->
                    <h5><i class="font-home"></i>参数设置</h5>
                </div><!-- /page header -->
                <div class="body">                
                    <!-- Content container -->
                    <div class="container"> 
                	
                        <!-- Site Summary -->
                        <div class="block well">
                        		<div class="navbar"><div class="navbar-inner"><h5><i class="font-th-list"></i>{$this_cg.title}</h5></div></div>
                            <ul class="toolbar">
                                <volist name="configgroup" id="cg">
																	<li <eq name="cg.name" value="$this_cg[name]"> class="current"</eq> ><a href="{:U('Admin/Config/setting?group='.$cg['name'])}"><i class="{$cg.icon}"></i><span>{$cg.title}</span></a></li>
																</volist>
                                <li><a href="{:U('Admin/Config/cache')}" dialog="after" checkbox="false" class="dialog-action"><i class="font-refresh"></i><span>更新缓存</span></a></li>
                            </ul>                        	
    	
<div class="table-overflow">
<FORM METHOD=POST id="form1" action="{:U('Admin/Config/saveConfig')}" enctype="multipart/form-data">
<TABLE class="table table-bordered table-block tableform">
<volist name="list" id="vo">
<TR>
	<TH style="width:20%;">{$vo.title}：</TH>
	<TD class="inputtext"><switch name="vo.type" >
	<case value="0"><INPUT TYPE="text" class="input-xxlarge" NAME="{$vo.name}" value="{$vo.value}" ></case>
	<case value="1"><INPUT TYPE="text" class="input-xxlarge" NAME="{$vo.name}" value="{$vo.value}"></case>
	<case value="2">
	<SELECT NAME="{$vo.name}" class="input-xxlarge">
	<option value="">选择</option>
	<?php if (!empty($vo['extra'])) { $option	=	explode(',',$vo['extra']);?>
	<option <?php if ($vo['value']=='0'){ ?>selected<?php };?> value="0"> {$option[0]} </option>
	<option <?php if ($vo['value']=='1'){ ?>selected<?php };?> value="1"> {$option[1]} </option>
	<?php }; ?>
	</SELECT>
	</case>
	<case value="3"><TEXTAREA class="input-xxlarge" NAME="{$vo.name}" ROWS="5">{$vo.value}</TEXTAREA></case>
	<case value="4">
	<SELECT NAME="{$vo.name}" class="input-xxlarge">
	<?php if (!empty($vo['extra'])) { $option	=	explode(',',$vo['extra']);?>
	<volist name="option" id="extra">
	<php>$array	=	explode(':',$extra);$value	=	$array[0];$show	=	isset($array[1])?$array[1]:$array[0];</php>
	<option <?php if ($vo['value']==$value){ ?>selected<?php };?> value="{$value}"> {$show} </option>
	</volist>
	<?php }; ?>
	</SELECT>
	</case>
	<case value="5">
	<datacall:baidueditor id="{$vo.name}" name="{$vo.name}" width="100%" >{$vo.value}</datacall:baidueditor>
	</case>
	<case value="6"><INPUT TYPE="file" id="{$vo.name}" class="uploadstyle input-xxlarge" NAME="{$vo.name}"><if condition="$vo[value]"> &nbsp;<a href="__PUBLIC__/Uploads/Config/{$vo.value}" target="_blank" class="btn btn-small btn-success"><i class="icon-file"></i> <span>查看文件</span></a></if></case>
	<case value="7">
	<?php if (!empty($vo['extra'])) { $option	=	explode(',',$vo['extra']);$values=explode('|||',$vo['value']);?>
	<input type="hidden" id="{$vo.name}" class="setting_ini" value="{$vo.value}" NAME="{$vo.name}">
	<volist name="option" id="extra">
	<php>$array	=	explode(':',$extra);$value	=	$array[0];$show	=	isset($array[1])?$array[1]:$array[0];</php>
	<label><input type="checkbox" class="{$vo.name}" onclick="setting_chk('{$vo.name}')" <?php if (in_array($value, $values)){ ?>checked<?php };?> value="{$value}">{$show}</label>
	</volist>
	<?php }; ?>
	</case>
	</switch></TD>
</TR>
</volist>
<TR>
	<TH></TH>
	<TD class="center"><INPUT TYPE="hidden" name="cg" value="{$cg.name}">
	<button type="submit" class="btn btn-primary">保 存</button>&nbsp;&nbsp;&nbsp;&nbsp;
	<button type="reset" onclick="javascript:history.go(-1);" class="btn btn-danger">取 消</button>		
	</TD>
</TR>
</TABLE>
</div>
</div>
</div>
</div>
</FORM>

<SCRIPT LANGUAGE="JavaScript">
<!--

jQuery(document).ready(function(){

});

function setting_chk(cls_id){
		var cls_value = "";
		jQuery("."+cls_id).each(function(){
				var chked = jQuery(this).attr("checked");
				if(chked){
					if(cls_value==""){
						cls_value = jQuery(this).val();
					}else{
						cls_value = cls_value+"|||"+jQuery(this).val();
					}
				}		
		});
		jQuery("#"+cls_id).val(cls_value);
}

//-->
</SCRIPT>